package com.xinchuang.controller;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import java.util.*;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.xinchuang.role.config.RoleConfig;
import com.xinchuang.role.entity.SystemHeader;
import com.xinchuang.service.actual.StasticsService;
import com.xinchuang.utils.MyUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import com.xinchuang.utils.CheckUtil;
import com.xinchuang.comment.R;
import com.xinchuang.comment.ResultCode;
import com.google.gson.Gson;

import java.text.SimpleDateFormat;

import com.xinchuang.utils.DateUtils;
import org.springframework.web.multipart.MultipartFile;
import org.apache.commons.lang3.StringUtils;
import com.xinchuang.service.StasticsModService;

/**
 * StasticsModController
 *
 * @date 2023-07-05
 */
@RestController
@RequestMapping("/stasticsMod")
@Api(value = "统计模块", tags = "统计模块")
public class StasticsModController {
    private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    @Resource
    private StasticsService stasticsService;

    @Resource
    private RoleConfig roleConfig;

    /**
     * 获取试模数据记录接口接口  函数名称getTryOutRecordList  功能描述:
     *
     * @param jsonObject 中文名:通用实体类
     * @return 返回参数{}
     */
    @PostMapping("/getTryOutRecordList")
    @ApiOperation("获取试模数据记录接口")
    public R getTryOutRecordList(@RequestBody JSONObject jsonObject, HttpServletRequest request) {
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        Set<String> sSet = new HashSet<>();
        String result = jsonLoop(jsonObject, "", methodName + "SC", sSet);
        result = result + getTryOutRecordListACS(sSet);
        if (result.length() > 0) {
            return R.fail("入参：" + result);
        } else {
            // 调用业务层代码
            String r = stasticsService.getTryOutRecordList(jsonObject);
            return JSON.parseObject(r, R.class);
        }
    }

    /**
     * 包装出库统计列表接口  函数名称packingOutList  功能描述:
     *
     * @param jsonObject 中文名:通用实体类
     * @return 返回参数{}
     */
    @PostMapping("/packingOutList")
    @ApiOperation("包装出库统计列表")
    public R packingOutList(@RequestBody JSONObject jsonObject, HttpServletRequest request) {
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        Set<String> sSet = new HashSet<>();
        String result = jsonLoop(jsonObject, "", methodName + "SC", sSet);
        result = result + packingOutListACS(sSet);
        if (result.length() > 0) {
            return R.fail("入参：" + result);
        } else {
            // 调用业务层代码
            String r = stasticsService.packingOutList(jsonObject);
            return JSON.parseObject(r, R.class);
        }
    }

    /**
     * 周月年试模统计接口  函数名称weekYearMonthStastics  功能描述:
     *
     * @param jsonObject 中文名:通用实体类
     * @return 返回参数{}
     */
    @PostMapping("/weekYearMonthStastics")
    @ApiOperation("周月年试模统计")
    public R weekYearMonthStastics(@RequestBody JSONObject jsonObject, HttpServletRequest request) {
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        Set<String> sSet = new HashSet<>();
        String result = jsonLoop(jsonObject, "", methodName + "SC", sSet);
        result = result + weekYearMonthStasticsACS(sSet);
        if (result.length() > 0) {
            return R.fail("入参：" + result);
        } else {
            // 调用业务层代码
            String r = stasticsService.weekYearMonthStastics(jsonObject);
            return JSON.parseObject(r, R.class);
        }
    }

    /**
     * 试模损失统计接口接口  函数名称lossStastics  功能描述:
     *
     * @return 返回参数{}
     */
    @PostMapping("/lossStastics")
    @ApiOperation("试模损失统计接口")
    public R lossStastics(@RequestBody JSONObject jsonObject, HttpServletRequest request) {
        // 调用业务层代码
        String r = stasticsService.lossStastics(jsonObject);
        return JSON.parseObject(r, R.class);
    }

    /**
     * 包装统计接口  函数名称packingOutStastics  功能描述:
     *
     * @param jsonObject 中文名:通用实体类
     * @return 返回参数{}
     */
    @PostMapping("/packingOutStastics")
    @ApiOperation("包装统计")
    public R packingOutStastics(@RequestBody JSONObject jsonObject, HttpServletRequest request) {
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        Set<String> sSet = new HashSet<>();
        String result = jsonLoop(jsonObject, "", methodName + "SC", sSet);
        result = result + packingOutStasticsACS(sSet);
        if (result.length() > 0) {
            return R.fail("入参：" + result);
        } else {
            // 调用业务层代码
            String r = stasticsService.packingOutStastics(jsonObject);
            return JSON.parseObject(r, R.class);
        }
    }

    /**
     * 试模次数统计接口  函数名称tryOutCountStastics  功能描述:
     *
     * @param jsonObject 中文名:通用实体类
     * @return 返回参数{}
     */
    @PostMapping("/tryOutCountStastics")
    @ApiOperation("试模次数统计")
    public R tryOutCountStastics(@RequestBody JSONObject jsonObject, HttpServletRequest request) {
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        Set<String> sSet = new HashSet<>();
        String result = jsonLoop(jsonObject, "", methodName + "SC", sSet);
        result = result + tryOutCountStasticsACS(sSet);
        if (result.length() > 0) {
            return R.fail("入参：" + result);
        } else {
            // 调用业务层代码
            String r = stasticsService.tryOutCountStastics(jsonObject);
            return JSON.parseObject(r, R.class);
        }
    }

    /**
     * 保存试模次数统计接口  函数名称saveTryOutCountStastics  功能描述:
     *
     * @param jsonObject 中文名:通用实体类
     * @return 返回参数{}
     */
    @PostMapping("/saveTryOutCountStastics")
    @ApiOperation("保存试模次数统计")
    public R saveTtryOutCountStastics(@RequestBody JSONObject jsonObject, HttpServletRequest request) {
        // 调用业务层代码
        String r = stasticsService.saveTryOutCountStastics(jsonObject);
        return JSON.parseObject(r, R.class);
    }

    /**
     * 保存试模数据记录接口接口  函数名称saveTryOutRecordList  功能描述:
     *
     * @param jsonObject 中文名:通用实体类
     * @return 返回参数{}
     */
    @PostMapping("/saveTryOutRecordList")
    @ApiOperation("保存试模数据记录接口")
    public R saveTryOutRecordList(@RequestBody JSONObject jsonObject, HttpServletRequest request) {
        String r = stasticsService.saveTryOutRecordList(jsonObject);
        return JSON.parseObject(r, R.class);
    }

    /**
     * 获取项目名称列表接口  函数名称getProjectNameList  功能描述:
     *
     * @return 返回参数{}
     */
    @PostMapping("/getProjectNameList")
    @ApiOperation("获取项目名称列表接口")
    public R getProjectNameList() {
        String r = stasticsService.getProjectNameList();
        return JSON.parseObject(r, R.class);
    }

    public static String jsonLoop(Object object, String result, String methodName, Set<String> set) {
        Object v = null;
        if (object instanceof JSONArray || object instanceof ArrayList) {
            JSONArray jsonArray = new JSONArray();
            if (object instanceof ArrayList) {
                jsonArray = JSONArray.parseArray(JSON.toJSONString(object));
            } else {
                jsonArray = (JSONArray) object;
            }
            for (int i = 0; i < jsonArray.size(); i++) {
                result = jsonLoop(jsonArray.get(i), result, methodName, set);
                if (StringUtils.isNotEmpty(result)) {
                    return result;
                }
            }
        }
        if (object instanceof JSONObject) {
            JSONObject jsonObject = (JSONObject) object;
            for (Map.Entry<String, Object> entry : jsonObject.entrySet()) {
                Object o = entry.getValue();
                if (o instanceof JSONArray || o instanceof ArrayList) {
                    result += selectCheckMathod(entry.getKey(), entry.getValue(), methodName, set);
                    result = jsonLoop(o, result, methodName, set);
                    if (StringUtils.isNotEmpty(result)) {
                        return result;
                    }
                } else if (o instanceof JSONObject) {
                    result = jsonLoop(o, result, methodName, set);
                    if (StringUtils.isNotEmpty(result)) {
                        return result;
                    }
                } else {
//                   FIXME: 未知类型
                }
                v = entry.getValue();
                result += selectCheckMathod(entry.getKey(), v, methodName, set);
            }
        }
        return result;
    }

    private static String selectCheckMathod(String key, Object value, String methodName, Set<String> set) {
        String result = "";
        if ("getTryOutRecordListSC".equals(methodName)) {
            result = getTryOutRecordListSC(key, value, set);
        }
        if ("getTryOutRecordListAC".equals(methodName)) {
            result = getTryOutRecordListAC(key, value, set);
        }
        if ("packingOutListSC".equals(methodName)) {
            result = packingOutListSC(key, value, set);
        }
        if ("packingOutListAC".equals(methodName)) {
            result = packingOutListAC(key, value, set);
        }
        if ("weekYearMonthStasticsSC".equals(methodName)) {
            result = weekYearMonthStasticsSC(key, value, set);
        }
        if ("weekYearMonthStasticsAC".equals(methodName)) {
            result = weekYearMonthStasticsAC(key, value, set);
        }
        if ("lossStasticsSC".equals(methodName)) {
            result = lossStasticsSC(key, value, set);
        }
        if ("lossStasticsAC".equals(methodName)) {
            result = lossStasticsAC(key, value, set);
        }
        if ("packingOutStasticsSC".equals(methodName)) {
            result = packingOutStasticsSC(key, value, set);
        }
        if ("packingOutStasticsAC".equals(methodName)) {
            result = packingOutStasticsAC(key, value, set);
        }
        if ("tryOutCountStasticsSC".equals(methodName)) {
            result = tryOutCountStasticsSC(key, value, set);
        }
        if ("tryOutCountStasticsAC".equals(methodName)) {
            result = tryOutCountStasticsAC(key, value, set);
        }
        return result;
    }


    private static String getTryOutRecordListSC(String key, Object value, Set<String> set) {
        String result = "";
        Boolean isNull = false;
        if ("pageSize".equals(key)) {
            isNull = true;
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkBigDecimal(value == null ? "" : value.toString(), "每页条数", isNull, "0", "255");
        }
        if ("pageNum".equals(key)) {
            isNull = true;
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkBigDecimal(value == null ? "" : value.toString(), "页码", isNull, "0", "255");
        }
        if ("moldId".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "模具工号", isNull, 0, 255);
        }
        if (isNull) {
            set.add(key);
        }
        return result;
    }

    private static String getTryOutRecordListAC(String key, Object value, Set<String> set) {
        String result = "";
        Boolean isNull = false;
        if ("code".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkBigDecimal(value == null ? "" : value.toString(), "状态码", isNull, "0", "100000");
        }
        if ("msg".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "返回消息", isNull, 0, 255);
        }
        if ("success".equals(key)) {
            // 判断参数类型: String  num boolean datetime
        }
        if ("totalNum".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "总条数", isNull, 0, 255);
        }
        if ("dataList".equals(key)) {
            result += CheckUtil.checkJSONArray(JSONArray.parseArray(JSON.toJSONString(value)), "数据列表", isNull);
        }
        if ("tongManName".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "钳工组", isNull, 0, 255);
        }
        if ("plannedTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            Date date = DateUtils.parseStringTimeToDate(value == null ? "" : value.toString());
            if (date == null) {
                result += "时间格式错误:null";
            } else {
                result += CheckUtil.checkDate(date, "计划试模日期", isNull);
            }
        }
        if ("moldReachedTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            Date date = DateUtils.parseStringTimeToDate(value == null ? "" : value.toString());
            if (date == null) {
                result += "时间格式错误:null";
            } else {
                result += CheckUtil.checkDate(date, "模具到达时间", isNull);
            }
        }
        if ("practicalTryOutDate".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            Date date = DateUtils.parseStringTimeToDate(value == null ? "" : value.toString());
            if (date == null) {
                result += "时间格式错误:null";
            } else {
                result += CheckUtil.checkDate(date, "实际试模日期", isNull);
            }
        }
        if ("isCompletedOnTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "是否按时完成", isNull, 0, 255);
        }
        if ("weekOfYear".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "周数", isNull, 0, 255);
        }
        if ("month".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "月份", isNull, 0, 255);
        }
        if ("projectName".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "项目名称", isNull, 0, 255);
        }
        if ("moldId".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "模号", isNull, 0, 255);
        }
        if ("targetCount".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "目标次数", isNull, 0, 255);
        }
        if ("realCountOfYear".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "本月实际试模次数", isNull, 0, 255);
        }
        if ("beyondExpectationCount".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "超出预期次数", isNull, 0, 255);
        }
        if ("rectificationAndVerification".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "整改验证", isNull, 0, 255);
        }
        if ("textureVerification".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "纹理验证", isNull, 0, 255);
        }
        if ("setupVerification".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "设变验证", isNull, 0, 255);
        }
        if ("unplannedProofing".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "计划外打样", isNull, 0, 255);
        }
        if ("materialVerification".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "材料验证", isNull, 0, 255);
        }
        if ("setupDeliveryTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "设变数据下发时间", isNull, 0, 255);
        }
        if ("reasonID".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "试模原因ID", isNull, 0, 255);
        }
        if ("projectName".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "项目经理", isNull, 0, 255);
        }
        if ("commissioningEngineer".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "调试（试模工）", isNull, 0, 255);
        }
        if ("tryOutPlace".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "试模地点", isNull, 0, 255);
        }
        if ("tryOutDeviceModel".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "试模设备型号", isNull, 0, 255);
        }
        if ("unitPriceOfTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "标准时间单价（与设备型号关联）", isNull, 0, 255);
        }
        if ("unitPrice".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "单价", isNull, 0, 255);
        }
        if ("loadMoldTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "上模时间", isNull, 0, 255);
        }
        if ("waitTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "等待时间", isNull, 0, 255);
        }
        if ("breakdownTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "设备故障(时间)", isNull, 0, 255);
        }
        if ("debugTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "调试时间", isNull, 0, 255);
        }
        if ("demoPoduceTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "样件生产时间", isNull, 0, 255);
        }
        if ("unloadTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "下模时间", isNull, 0, 255);
        }
        if ("totalTimeWithoutWait".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "试模总时间（H）无等", isNull, 0, 255);
        }
        if ("totalTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "试模总时间(H)/全", isNull, 0, 255);
        }
        if ("normalTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "正常时间", isNull, 0, 255);
        }
        if ("expectTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "异常时间（全）", isNull, 0, 255);
        }
        if ("expectTimeWithoutWait".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "异常时间（无等）", isNull, 0, 255);
        }
        if ("totalFeeWithoutWait".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "总费用（无等）", isNull, 0, 255);
        }
        if ("normalTryOutFee".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "标准试模费用", isNull, 0, 255);
        }
        if ("overtimeTryOutFee".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "超时试模费用", isNull, 0, 255);
        }
        if ("totalFee".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "总费用（全）", isNull, 0, 255);
        }
        if ("expectFee".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "异常费用（全）", isNull, 0, 255);
        }
        if ("expectTimeWithOutWait".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "异常费用（无等）", isNull, 0, 255);
        }
        if ("tryOutLoss".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "试模损失（全）", isNull, 0, 255);
        }
        if ("loss".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "损失", isNull, 0, 255);
        }
        if (isNull) {
            set.add(key);
        }
        return result;
    }

    private static String packingOutListSC(String key, Object value, Set<String> set) {
        String result = "";
        Boolean isNull = false;
        if ("moldId".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "模具工号", isNull, 0, 255);
        }
        if ("projectName".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "项目名称", isNull, 0, 255);
        }
        if ("pageNum".equals(key)) {
            isNull = true;
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkBigDecimal(value == null ? "" : value.toString(), "页码", isNull, "0", "255");
        }
        if ("pageSize".equals(key)) {
            isNull = true;
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkBigDecimal(value == null ? "" : value.toString(), "每页数量", isNull, "1", "1000");
        }
        if (isNull) {
            set.add(key);
        }
        return result;
    }

    private static String packingOutListAC(String key, Object value, Set<String> set) {
        String result = "";
        Boolean isNull = false;
        if ("code".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkBigDecimal(value == null ? "" : value.toString(), "状态码", isNull, "0", "100000");
        }
        if ("msg".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "返回消息", isNull, 0, 255);
        }
        if ("success".equals(key)) {
            // 判断参数类型: String  num boolean datetime
        }
        if ("totalCount".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "总条数", isNull, 0, 255);
        }
        if ("dataList".equals(key)) {
            result += CheckUtil.checkJSONArray(JSONArray.parseArray(JSON.toJSONString(value)), "统计数据", isNull);
        }
        if ("receiveDate".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "领用日期", isNull, 0, 255);
        }
        if ("projectName".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "项目名称", isNull, 0, 255);
        }
        if ("moldId".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "模工号", isNull, 0, 255);
        }
        if ("receivedType".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "领用物资类", isNull, 0, 255);
        }
        if ("specification".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "规格", isNull, 0, 255);
        }
        if ("unit".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "单位", isNull, 0, 255);
        }
        if ("receiveCount".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "领用数量", isNull, 0, 255);
        }
        if ("returnCount".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "退库", isNull, 0, 255);
        }
        if ("consumeCount".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "消耗数量", isNull, 0, 255);
        }
        if ("excessCount".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "超额数量", isNull, 0, 255);
        }
        if ("debugMoldCount".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "调试模数", isNull, 0, 255);
        }
        if ("produceMoldCount".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "生产模数", isNull, 0, 255);
        }
        if ("qualifiedMoldCount".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "合格品数", isNull, 0, 255);
        }
        if ("concessionalReceivingCount".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "让步接收数", isNull, 0, 255);
        }
        if ("moldWeight".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "单模重量（g)", isNull, 0, 255);
        }
        if (isNull) {
            set.add(key);
        }
        return result;
    }

    private static String weekYearMonthStasticsSC(String key, Object value, Set<String> set) {
        String result = "";
        Boolean isNull = false;
        if ("week".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "查询第几周", isNull, 0, 255);
        }
        if ("month".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "查询第几月", isNull, 0, 255);
        }
        if ("year".equals(key)) {
            isNull = true;
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "查询哪一年", isNull, 0, 255);
        }
        if (isNull) {
            set.add(key);
        }
        return result;
    }

    private static String weekYearMonthStasticsAC(String key, Object value, Set<String> set) {
        String result = "";
        Boolean isNull = false;
        if ("code".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkBigDecimal(value == null ? "" : value.toString(), "状态码", isNull, "0", "100000");
        }
        if ("msg".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "返回消息", isNull, 0, 255);
        }
        if ("success".equals(key)) {
            // 判断参数类型: String  num boolean datetime
        }
        if ("from".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "从", isNull, 0, 255);
        }
        if ("to".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "至", isNull, 0, 255);
        }
        if ("dataList".equals(key)) {
            result += CheckUtil.checkJSONArray(JSONArray.parseArray(JSON.toJSONString(value)), "周/月/年数据", isNull);
        }
        if ("companyName".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "试模单位名称", isNull, 0, 255);
        }
        if ("numOfTestSets".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "试模套数", isNull, 0, 255);
        }
        if ("numOfOnTimeSets".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "按时完成套数", isNull, 0, 255);
        }
        if ("rateOfOnTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "按时完成率", isNull, 0, 255);
        }
        if ("numOfSets".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "T0试模套数", isNull, 0, 255);
        }
        if ("numOfOnTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "T0按时套数", isNull, 0, 255);
        }
        if ("rateOfOnTimeOfT0".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "T0按时完成率", isNull, 0, 255);
        }
        if ("totalTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "总试模时间（H）", isNull, 0, 255);
        }
        if ("totalTryOutFee".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "总试模费用（元）", isNull, 0, 255);
        }
        if ("exceptTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "异常时间（H)", isNull, 0, 255);
        }
        if ("lossFee".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "损失费用(元）", isNull, 0, 255);
        }
        if (isNull) {
            set.add(key);
        }
        return result;
    }

    private static String lossStasticsSC(String key, Object value, Set<String> set) {
        String result = "";
        Boolean isNull = false;
        if (isNull) {
            set.add(key);
        }
        return result;
    }

    private static String lossStasticsAC(String key, Object value, Set<String> set) {
        String result = "";
        Boolean isNull = false;
        if ("code".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkBigDecimal(value == null ? "" : value.toString(), "状态码", isNull, "0", "100000");
        }
        if ("msg".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "返回消息", isNull, 0, 255);
        }
        if ("success".equals(key)) {
            // 判断参数类型: String  num boolean datetime
        }
        if ("detailOfYearData".equals(key)) {
            result += CheckUtil.checkJSONArray(JSONArray.parseArray(JSON.toJSONString(value)), "每月试模明细", isNull);
        }
        if ("month".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "月份", isNull, 0, 255);
        }
        if ("tryOutTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "试模次数", isNull, 0, 255);
        }
        if ("tryOutTimeInFive".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "5次内试模数量", isNull, 0, 255);
        }
        if ("rateOfNormalTimes".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "正常次数试模比例", isNull, 0, 255);
        }
        if ("totalFee".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "试模总费用", isNull, 0, 255);
        }
        if ("exceptLoss".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "异常损失费用", isNull, 0, 255);
        }
        if ("rateOfexceptLoss".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "异常损失占比", isNull, 0, 255);
        }
        if ("tryOutLoss".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "试模损失", isNull, 0, 255);
        }
        if ("rateOfTryOutLoss".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "试模损失占比", isNull, 0, 255);
        }
        if ("rateOfExceptLossInNormalTimes".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "正常次数内异常损失占比", isNull, 0, 255);
        }
        if ("exceptData".equals(key)) {
            result += CheckUtil.checkJSONArray(JSONArray.parseArray(JSON.toJSONString(value)), "试模分析-试模异常", isNull);
        }
        if ("targetData".equals(key)) {
            result += CheckUtil.checkJSONArray(JSONArray.parseArray(JSON.toJSONString(value)), "试模分析-试模目的（费用）", isNull);
        }
        if ("month".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "月份", isNull, 0, 255);
        }
        if ("totalTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "总时间", isNull, 0, 255);
        }
        if ("waitTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "等待时间", isNull, 0, 255);
        }
        if ("breakdownTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "设备故障时间", isNull, 0, 255);
        }
        if ("fixTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "修模时间", isNull, 0, 255);
        }
        if ("month".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "月份", isNull, 0, 255);
        }
        if ("T0Verification".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "T0验证", isNull, 0, 255);
        }
        if ("rectificationAndVerification".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "整改验证", isNull, 0, 255);
        }
        if ("textureVerification".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "纹理验证", isNull, 0, 255);
        }
        if ("setupVerification".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "设变验证", isNull, 0, 255);
        }
        if ("unplannedProofing".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "计划外打样", isNull, 0, 255);
        }
        if ("materialVerification".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "材料验证", isNull, 0, 255);
        }
        if ("planWithoutModificationProofing".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "有计划无整改打样", isNull, 0, 255);
        }
        if (isNull) {
            set.add(key);
        }
        return result;
    }

    private static String packingOutStasticsSC(String key, Object value, Set<String> set) {
        String result = "";
        Boolean isNull = false;
        if ("projectName".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "项目名称", isNull, 0, 255);
        }
        if ("receivedCount".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "领用数量", isNull, 0, 255);
        }
        if ("qualifiedCount".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "合格品数量", isNull, 0, 255);
        }
        if (isNull) {
            set.add(key);
        }
        return result;
    }

    private static String packingOutStasticsAC(String key, Object value, Set<String> set) {
        String result = "";
        Boolean isNull = false;
        if ("code".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkBigDecimal(value == null ? "" : value.toString(), "状态码", isNull, "0", "100000");
        }
        if ("msg".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "返回消息", isNull, 0, 255);
        }
        if ("success".equals(key)) {
            // 判断参数类型: String  num boolean datetime
        }
        if ("receivedCount".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "领用数量", isNull, 0, 255);
        }
        if ("dataList".equals(key)) {
            result += CheckUtil.checkJSONArray(JSONArray.parseArray(JSON.toJSONString(value)), "数据列表", isNull);
        }
        if ("typeName".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "物资类别名称", isNull, 0, 255);
        }
        if ("qualifiedCount".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "合格品数量", isNull, 0, 255);
        }
        if (isNull) {
            set.add(key);
        }
        return result;
    }

    private static String tryOutCountStasticsSC(String key, Object value, Set<String> set) {
        String result = "";
        Boolean isNull = false;
        if ("moldId".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "模具工号", isNull, 0, 255);
        }
        if ("moldName".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "模具名称", isNull, 0, 255);
        }
        if ("appearanceRequire".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "外观要求", isNull, 0, 255);
        }
        if ("projectManagerName".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "项目经理", isNull, 0, 255);
        }
        if ("plannedT0Time".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "计划T0时间", isNull, 0, 255);
        }
        if ("totalTargetTryOutTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "合计目标试模次数", isNull, 0, 255);
        }
        if ("appearanceRequirement".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "光样前", isNull, 0, 255);
        }
        if ("textureVerification".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "纹理验证", isNull, 0, 255);
        }
        if ("pageNum".equals(key)) {
            isNull = true;
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "页码", isNull, 0, 255);
        }
        if ("pageSize".equals(key)) {
            isNull = true;
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "每页条数", isNull, 0, 255);
        }
        if (isNull) {
            set.add(key);
        }
        return result;
    }

    private static String tryOutCountStasticsAC(String key, Object value, Set<String> set) {
        String result = "";
        Boolean isNull = false;
        if ("code".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkBigDecimal(value == null ? "" : value.toString(), "状态码", isNull, "0", "100000");
        }
        if ("msg".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "返回消息", isNull, 0, 255);
        }
        if ("success".equals(key)) {
            // 判断参数类型: String  num boolean datetime
        }
        if ("data".equals(key)) {
            result += CheckUtil.checkJSONArray(JSONArray.parseArray(JSON.toJSONString(value)), "承载数据", isNull);
        }
        if ("remark".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "备注", isNull, 0, 255);
        }
        if ("moldId".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "模具工号", isNull, 0, 255);
        }
        if ("moldName".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "模具名称", isNull, 0, 255);
        }
        if ("appearanceRequire".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "外观要求", isNull, 0, 255);
        }
        if ("projectManagerName".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "项目经理", isNull, 0, 255);
        }
        if ("plannedT0Time".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "计划T0时间", isNull, 0, 255);
        }
        if ("totalTargetTryOutTime".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "合计目标试模次数", isNull, 0, 255);
        }
        if ("appearanceRequirement".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "光样前", isNull, 0, 255);
        }
        if ("textureVerification".equals(key)) {
            // 判断参数类型: String  num boolean datetime
            result += CheckUtil.checkString(value == null ? "" : value.toString(), "纹理验证", isNull, 0, 255);
        }
        if (isNull) {
            set.add(key);
        }
        return result;
    }

    private static String getTryOutRecordListACS(Set<String> set) {
        List<String> list = new ArrayList<>();
        list.add("pageSize");
        list.add("pageNum");
        if (set.size() == list.size()) {
            return "";
        }
        return getCollectionDifferentValue(list, set, "入参");
    }

    private static String getTryOutRecordListACB(Set<String> set) {
        List<String> list = new ArrayList<>();
        if (set.size() == list.size()) {
            return "";
        }
        return getCollectionDifferentValue(list, set, "出参");
    }

    private static String packingOutListACS(Set<String> set) {
        List<String> list = new ArrayList<>();
        list.add("pageSize");
        list.add("pageNum");
        if (set.size() == list.size()) {
            return "";
        }
        return getCollectionDifferentValue(list, set, "入参");
    }

    private static String packingOutListACB(Set<String> set) {
        List<String> list = new ArrayList<>();
        if (set.size() == list.size()) {
            return "";
        }
        return getCollectionDifferentValue(list, set, "出参");
    }

    private static String weekYearMonthStasticsACS(Set<String> set) {
        List<String> list = new ArrayList<>();
        list.add("year");
        if (set.size() == list.size()) {
            return "";
        }
        return getCollectionDifferentValue(list, set, "入参");
    }

    private static String weekYearMonthStasticsACB(Set<String> set) {
        List<String> list = new ArrayList<>();
        if (set.size() == list.size()) {
            return "";
        }
        return getCollectionDifferentValue(list, set, "出参");
    }

    private static String lossStasticsACS(Set<String> set) {
        List<String> list = new ArrayList<>();
        if (set.size() == list.size()) {
            return "";
        }
        return getCollectionDifferentValue(list, set, "入参");
    }

    private static String lossStasticsACB(Set<String> set) {
        List<String> list = new ArrayList<>();
        if (set.size() == list.size()) {
            return "";
        }
        return getCollectionDifferentValue(list, set, "出参");
    }

    private static String packingOutStasticsACS(Set<String> set) {
        List<String> list = new ArrayList<>();
        if (set.size() == list.size()) {
            return "";
        }
        return getCollectionDifferentValue(list, set, "入参");
    }

    private static String packingOutStasticsACB(Set<String> set) {
        List<String> list = new ArrayList<>();
        if (set.size() == list.size()) {
            return "";
        }
        return getCollectionDifferentValue(list, set, "出参");
    }

    private static String tryOutCountStasticsACS(Set<String> set) {
        List<String> list = new ArrayList<>();
        list.add("pageNum");
        list.add("pageSize");
        if (set.size() == list.size()) {
            return "";
        }
        return getCollectionDifferentValue(list, set, "入参");
    }

    private static String tryOutCountStasticsACB(Set<String> set) {
        List<String> list = new ArrayList<>();
        if (set.size() == list.size()) {
            return "";
        }
        return getCollectionDifferentValue(list, set, "出参");
    }

    private static String saveTtryOutCountStasticsACS(Set<String> set) {
        List<String> list = new ArrayList<>();
        if (set.size() == list.size()) {
            return "";
        }
        return getCollectionDifferentValue(list, set, "入参");
    }

    private static String saveTtryOutCountStasticsACB(Set<String> set) {
        List<String> list = new ArrayList<>();
        if (set.size() == list.size()) {
            return "";
        }
        return getCollectionDifferentValue(list, set, "出参");
    }

    /**
     * 获取集合中的不同值
     *
     * @param list
     * @param set
     * @return
     */
    private static String getCollectionDifferentValue(List<String> list, Set<String> set, String flag) {
        String result = "";
        for (String str : list) {
            if (!set.contains(str)) {
                result += str + ",";
            }
        }
        if (StringUtils.isNotEmpty(result)) {
            result = StringUtils.strip(result, ",");
            result = "---" + flag + ":" + result + "为必填参数";
        }
        return result;
    }
}
